home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18359 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.7 KB  |  59 lines

  1. Newsgroups: comp.lang.c++,comp.lang.eiffel,comp.object,comp.arch
  2. Path: vixen.cso.uiuc.edu!uchinews!news
  3. From: Bob Hathaway <rjh@geodesic.com>
  4. Subject: Re: Real OO
  5. X-Nntp-Posting-Host: ford.uchicago.edu
  6. Message-ID: <Dq54Ko.8Ku@midway.uchicago.edu>
  7. Keywords: function
  8. Sender: news@midway.uchicago.edu (News Administrator)
  9. Organization: Geodesic Systems
  10. References: <65lDeVZF3RB@herold.franken.de> <4kbl7r$1i8@gaia.ns.utk.edu> <4ke84h$iiv@watnews1.watson.ibm.com> <jgkDpzFnD.KL7@netcom.com>
  11. Date: Sat, 20 Apr 1996 03:05:12 GMT
  12.  
  13. In article <jgkDpzFnD.KL7@netcom.com>, Joe Keane  <jgk@netcom.com> wrote:
  14. >In article <4kbl7r$1i8@gaia.ns.utk.edu>
  15. >Matt Kennel <mbk@caffeine.engr.utk.edu> writes: 
  16. >>My experience with Sather numerical classes is that the cost of
  17. >>indirect calls is not the actual indirection, but the lost
  18. >>opportunities for inlining.
  19. >
  20. >In article <4ke84h$iiv@watnews1.watson.ibm.com>
  21. >Norman H. Cohen <ncohen@watson.ibm.com> writes:
  22. >>Plus the opportunities that arise from cross-procedural analysis, for
  23. >>compilers that perform such analysis for statically bound subprograms.
  24. >>
  25. >>(But remember, in counting the cost of the actual indirection, to count
  26. >>machine cycles rather than instruction path length.  Indirect function
  27. >>calls can cause expensive I-cache misses on some architectures.)
  28. >
  29. >Ding ding ding!  People too often concentrate on the number of
  30. >instructions to just do the function call, either static or virtual.
  31. >
  32. >In my experience that's not the thing; rather it's that when you inline
  33. >a function the compiler has much more oppurtunity for optimization.
  34. >This comes from a variety of reasons, and i'm convinced that in real
  35. >situations this is more important than a couple cycles to jump.
  36.  
  37. Ding ding ding! In my experience that's not the thing; rather it's that when
  38. you design software it reflects your model properly and supports the best
  39. polymorphic model.  Efficiency comes after effectiveness as long as the
  40. time constraint requirements are met.  And computer speeds are getting
  41. faster all the time - the last time I checked the speed of a PC they ran
  42. at about 200Mz - no reason to stop optimizing though.
  43.  
  44. Also, interprocedural analysis can do this too without increasing static
  45. code size (Time/Space opt).  But you're right that if the function *really*
  46. can't be determined then things like DU chains get cut for conservatism,
  47. as in object code libraries. 
  48.  
  49. >If the function being called isn't known at compile time, the compiler
  50. >must assume the worst, even though it's quite likely that the function
  51. >will turn out to be something very simple.
  52.  
  53. There are optimizations for multiple-polymorphism that can turn these
  54. inherent typed calls into inlines.  Check the comp.object FAQ for references.
  55. I think it covers this issue, as I wrote it!
  56.  
  57. Best Regards,
  58. Bob
  59.